Open
Conversation
a713153 to
685a0eb
Compare
5617f0c to
2122d49
Compare
There was a problem hiding this comment.
Pull request overview
This PR integrates KPI calculation functionality into the simulator-worker by adding the kpi-calculator package from PyPI. The integration adds KPI computation to the simulation workflow while maintaining graceful error handling to ensure simulations can complete even if KPI calculation fails.
Changes:
- Added kpi-calculator>=0.1.1 dependency and updated urllib3 to 2.6.3
- Integrated KPI calculation into simulator_worker.py after simulation completion
- Added convert_simulator_to_kpi_format utility function to transform simulator output format to KPI calculator format
- Added comprehensive integration tests for KPI functionality
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added kpi-calculator dependency and updated pytest configuration to include new test file |
| dev-requirements.txt | Updated urllib3 dependency version |
| src/simulator_worker/simulator_worker.py | Integrated KPI calculation workflow with error handling |
| src/simulator_worker/utils.py | Added utility function to convert simulator DataFrame format to KPI calculator format |
| unit_test/test_kpi_integration.py | Added comprehensive integration tests for KPI functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2122d49 to
7ae989c
Compare
969737b to
5ee1199
Compare
5ee1199 to
85a8e8c
Compare
85a8e8c to
6c4befb
Compare
6c4befb to
770dfb1
Compare
Author
|
This PR is now updated with the new pre-release of the KPI calculator. |
- Add kpi-calculator>=0.4.0a2 dependency - Use KpiManager.load_from_simulator and build_esdl_string_with_kpis - Use logger.exception for KPI failure handling - Fix log message: "Results will be returned without KPIs" - Use ProtobufDict type annotation in integration test - Update energy KPI assertion to match actual simulator output
770dfb1 to
3615575
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build_esdl_string_with_kpis to embed the results into the output ESDL string